<div id="my_toolbar">
  <% if session[:user_id] %>
    <% @user =  User.find(session[:user_id])%>
    <h2><%=@user.login%> <span style="font-size:12px;">我的积分: <%=@user.point%></span></h2>


    <ul class="toolbar_list">

      <li>
        <%= link_to "我的订单",'/store/mine',:title=>'我的订单',:class=>"action_order" %>
      </li>

      <li>
        <a href="/users/<%=@user.id%>/edit" class="action_edit_pw" title="修改资料">修改资料</a>
      </li>

      <li>
        <a href="/users/change_password/<%=@user.id%>" class="action_edit_pw" title="修改密码">修改密码</a>
      </li>

      <li>
        <a href="/users/generate_recommend_code" class="action_boy" title="推荐新会员">推荐新会员</a>
      </li>

      <li>
        <a href="/sessions/destroy" class="action_logout">注销登录</a>
      </li>
      <%if admin? %>
        <li>
          <%= link_to "新增商品",'/products/new',:title=>'新增商品',:class=>"action_add" %>
        </li>
        <li>
          <%= link_to "激活商品",'/products/re_active',:title=>'激活商品',:class=>"action_history" %>
        </li>
        <li>
          <%= link_to "管理类别",'/categories',:title=>'管理类别',:class=>"action_edit" %>
        </li>

        <li>
          <a href="/brands" class="action_edit" title="管理品牌">管理品牌</a>
        </li>

        <li>
          <a href="/users" class="action_boy">管理用户</a>
        </li>
      </ul>
    <% end %>


  <%else%>
    <% form_tag session_path do -%>
      <h2>会员登陆:</h2>
      <label>账号:</label>
      <%= text_field_tag 'login','',:class=>'login_input',:value=>cookies[:user_login] %>
      <label>密码:</label>
      <%= password_field_tag 'password','',:class=>'login_input' %>
      <div id="login_toolbar">
        <div><input name=""  value="登陆" type="submit" id="login_bt"></div>
        <div><a href="/users/new">注册</a></div>
        <div style="padding:0 5px 0 5px;">|</div>
        <div>记住我<%= check_box_tag 'remember_me' %></div>
      </div>
    <% end -%>
  <%end%>

</div>